home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / CacheExpiration.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  10.7 KB  |  269 lines

  1. ∩╗┐<%@ Language=VBScript CODEPAGE=65001 %>
  2. <!--#include file="include/wmsLocStrings.inc"-->
  3. <!--#include file="include/wmsCommon.inc"-->
  4. <!--#include file="include/wmsHeader.inc"-->
  5. <!--#include file="include/wmsPageBanner.inc"-->
  6. <!--#include file="include/wmsServerHash.inc"-->
  7. <!--#include file="include/wmsPlugins.inc"-->
  8. <!--#include file="include/wmsError.inc"-->
  9. <%
  10. '+-------------------------------------------------------------------------
  11. '
  12. '  Microsoft Windows Media
  13. '  Copyright (C) Microsoft Corporation. All rights reserved.
  14. '
  15. '  File:       CacheExpiration.asp
  16. '
  17. '  Contents:   Stream splitting expiration property page
  18. '
  19. '--------------------------------------------------------------------------
  20.  
  21. BeginErrorHandling
  22. ConnectToServer
  23. ConnectToPubPoint
  24.  
  25. Const MAX_EXPIRATION_VAL = 8388607
  26.  
  27. Dim szOp
  28. Dim szRadioOption
  29.  
  30. Dim iPPindex
  31.  
  32. Dim bBufferOnServer
  33. Dim enumBufferSetting
  34.  
  35. Dim lExpirationVal
  36.  
  37. Dim bFinished
  38. bFinished = FALSE
  39.  
  40. szOp = GetPostOrQsVal("submit")
  41. if( 0 = Len( szOp ) ) then
  42.     szOp = trim( posting( "submit" ) )
  43. end if
  44.  
  45. if( 0 < Len( szOp ) ) then
  46.     szRadioOption = GetPostOrQsVal( "expiration" )
  47.     szSecsToExpire = GetPostOrQsVal( "secsToExpiration" )
  48.     if( 0 < Len( szSecsToExpire ) ) then
  49.         dwSecsToExpire = CDbl( szSecsToExpire )
  50.     end if
  51.     if( 0 = strcomp( szRadioOption, "1", vbTextCompare ) ) then
  52.         if( dwSecsToExpire <= MAX_EXPIRATION_VAL ) then
  53.             g_objPubPoint.CacheProxyExpiration = dwSecsToExpire
  54.         end if
  55.         Response.Redirect( "pubpoint_props.asp?server=" & g_strQueryStringServer &  "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&instance=" & g_strEncodedInstance )
  56.         Response.Flush
  57.     else
  58.         g_objPubPoint.CacheProxyExpiration = szRadioOption
  59.         Response.Redirect( "pubpoint_props.asp?server=" & g_strQueryStringServer &  "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&instance=" & g_strEncodedInstance )
  60.         Response.Flush
  61.     end if
  62. end if
  63.  
  64. if( bFinished ) then
  65.     Response.Redirect( "pubpoint_props.asp?server=" & g_strQueryStringServer &  "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&instance=" & g_strEncodedInstance )
  66. end if
  67.  
  68. WriteHTMLHeader( RemoveDangerousCharacters( g_strDecodedInstance ) ) %>
  69. <% WritePluginJSUtils %>
  70. <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
  71. <script language="javascript">
  72. /*@cc_on @*/
  73.  
  74. //////////////////////////////////////////////////////////////////////////
  75. function EnableButtons()
  76. {
  77.     <% jsTRY %>
  78.     document.forms.pluginForm.secsToExpiration.disabled = ! ( document.forms.pluginForm.expiration[0].checked );
  79.     ValidateExpiration();
  80.     <% jsCATCH %>
  81. }
  82.  
  83. var g_bAlreadyAlertedUser = false;
  84. var g_bAlertToValueOutOfRange = false;
  85.  
  86. //////////////////////////////////////////////////////////////////////////
  87. function ValidateExpiration()
  88. {
  89.     <% jsTRY %>
  90.         if( document.forms.pluginForm.expiration[ 0 ].checked )
  91.         {
  92.             var szTextEdit;    
  93.             szTextEdit = document.forms.pluginForm.secsToExpiration.value;
  94.             
  95.             if( isNaN( szTextEdit ) )
  96.             {
  97.             <% if brMSIE = g_dwBrowserType then %>
  98.                 if( ( ! g_bAlreadyAlertedUser ) && document.forms.pluginForm.secsToExpiration.style.color != "#ff0000" )
  99.             <% else %>
  100.                 if( ( ! g_bAlreadyAlertedUser ) && document.forms.pluginForm.secsToExpiration.style.color != "rgb(255,0,0)" )
  101.             <% end if %>
  102.                 {
  103.                     g_bAlreadyAlertedUser = true;
  104.                     window.alert( "<%= RemoveDangerousCharacters( L_INVALIDENTRY_TEXT ) %>" );
  105.                 }
  106.                 else
  107.                 {
  108.                     window.status = "<%= RemoveDangerousCharacters( L_INVALIDENTRY_TEXT ) %>";
  109.                 }
  110.                 document.forms.pluginForm.secsToExpiration.style.color = "#ff0000";
  111.                 document.forms.pluginForm.ok.disabled = true;
  112.         //        document.forms.pluginForm.secsToExpiration.value = "";
  113.                 return( true );
  114.             }
  115.             
  116.             if( <%= Server.HTMLEncode( MAX_EXPIRATION_VAL ) %> < szTextEdit )
  117.             {
  118.                 if( ! g_bAlertToValueOutOfRange )
  119.                 {
  120.                     g_bAlertToValueOutOfRange = true;
  121.                     window.alert( "<%= RemoveDangerousCharacters( L_VALOUTOFRANGE_TEXT ) %>" );
  122.                 }
  123. //                document.forms.pluginForm.secsToExpiration.value = "<%= Server.HTMLEncode( MAX_EXPIRATION ) %>";
  124.                 document.forms.pluginForm.secsToExpiration.style.color = "#ff0000";
  125.                 document.forms.pluginForm.ok.disabled = true;
  126.                 return( true );
  127.             }
  128.             else
  129.             {
  130.                 if( 0 >= szTextEdit )
  131.                 {
  132.                     document.forms.pluginForm.secsToExpiration.style.color = "#ff0000";
  133.                     document.forms.pluginForm.ok.disabled = true;
  134.                     return( false );
  135.                 }
  136.             }
  137.         }
  138.         document.pluginForm.secsToExpiration.style.color = "#000000";
  139.         document.forms.pluginForm.ok.disabled = false;
  140.         window.status = "";
  141.         return( false );
  142.     <% jsCATCH %>
  143. }
  144. </script>
  145. </head>
  146. <body class="pluginBody" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
  147. <% 
  148. if( WMS_PUBLISHING_POINT_TYPE_BROADCAST = g_objPubPoint.Type ) then
  149.     DrawPropPageBanner L_CACHEPROXSPPROP_TEXT 
  150. else
  151.     DrawPropPageBanner L_CACHEPROXSPPROPOD_TEXT 
  152. end if
  153. %>
  154. <table border="0" cellpadding="0" cellspacing="0" width="90%">
  155. <tr>
  156.     <td>
  157.          
  158.     </td>
  159.     <td valign="top">
  160.  
  161.         <% WriteStdPluginForm %>
  162.     
  163.         <p> <br>
  164. <%                   
  165. lExpiration = g_objPubPoint.CacheProxyExpiration 
  166. %>            
  167.         <table class="propgroupbox" cellspacing="1" cellpadding="0" border="0" width="90%">
  168.         <tr>
  169.             <td colspan="3">
  170.                 <div class="subheader"><%= Server.HTMLEncode( L_CACHEEXPNAME_TEXT ) %></div><br>
  171.                 <table cellspacing="1" cellpadding="0" border="0">
  172.                 <tr>
  173.                     <td> </td>
  174.                     <td>
  175.                         <div class="propshand">
  176.                         <input type="radio"
  177.                                name="expiration"
  178.                                id="radio1"
  179.                                value="1"
  180.                                tabindex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> 
  181.                                 <% if lExpiration > 0 then %> checked <% end if %>
  182.                                onClick="JavaScript:document.forms.pluginForm.expiration[0].checked = true;EnableButtons();"
  183.                         >
  184.                         <label for="radio1" class="propshand"><span nowrap><% RenderWithErrorCheck Server.HTMLEncode( L_CPMAFTER_TEXT ), "enable" %></nowrap></label>
  185.                         </div>
  186.                     </td>
  187.                     <td>
  188.                           <input type="text"
  189.                                name="secsToExpiration" <%
  190.                                if( 0 >= lExpiration ) then%>disabled<%
  191.                                end if
  192.                                %>
  193.                                maxlenth=7
  194.                                value="<% if( 0 < lExpiration ) then %><%= lExpiration %><% else %>86400<% end if %>"
  195.                                onClick="JavaScript:EnableButtons();"
  196.                                onChange="JavaScript:ValidateExpiration();"
  197.                                onPaste="JavaScript:ValidateExpiration();"
  198.                                onKeyUp="JavaScript:ValidateExpiration();"
  199.                                tabindex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> 
  200.                         >
  201.                     </td>
  202.                 </tr>
  203.                 <tr>
  204.                     <td> </td>
  205.                     <td>
  206.                         <div class="propshand">
  207.                         <input type="radio"
  208.                                name="expiration"
  209.                                id="radio2"
  210.                                value="0"
  211.                                tabindex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> 
  212.                                 <% if 0 = lExpiration then %> checked <% end if %>
  213.                                onClick="JavaScript:EnableButtons();"
  214.                                onChange="JavaScript:EnableButtons();"
  215.                         >
  216.                         <label for="radio2" class="propshand"><span nowrap><% RenderWithErrorCheck Server.HTMLEncode( L_CPMIMMED_TEXT ), "enable" %></span></label>
  217.                         </div>
  218.                     </td>
  219.                 </tr>
  220.                 <tr>
  221.                     <td> </td>
  222.                     <td>
  223.                         <div class="propshand">
  224.                         <input type="radio"
  225.                                name="expiration"
  226.                                id="radio3"
  227.                                value="-1"
  228.                                tabindex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> 
  229.                                 <% if -1 = lExpiration then %> checked <% end if %>
  230.                                onClick="JavaScript:EnableButtons();"
  231.                                onChange="JavaScript:EnableButtons();"
  232.                         >
  233.                         <label for="radio3" class="propshand"><span nowrap><% RenderWithErrorCheck Server.HTMLEncode( L_CPMNEVER_TEXT ), "enable" %></span></label>
  234.                         </div>
  235.                     </td>
  236.                 </tr>
  237.                 </table>
  238.                 <br>
  239.     </td>
  240. </tr>
  241. </table>
  242. <table cellspacing="0" cellpadding="0" border="0">
  243. <tr>
  244.     <td valign=bottom>
  245.         <br>
  246.         <input type="submit" align="baseline" name="ok"  tabIndex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> value="<%= Server.HTMLEncode( L_OKAYBUTTON_TEXT ) %>"> 
  247.         <input type="button" align="baseline" name="cancel" tabIndex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> onclick="JavaScript:Cancel();" value="<%= Server.HTMLEncode( L_CANCELBUTTONSPACED_TEXT ) %>"> 
  248.         <input type="button" align="baseline" name="help" tabIndex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> onclick="JavaScript:DoPluginHelp( '<%= H_CACHEPROXYTOPIC %>' )" value="<%= Server.HTMLEncode( L_HELPBUTTONSPACED_TEXT ) %>" id="help">
  249.     </td>
  250. </tr>
  251. </table>
  252. </font>
  253. </form>
  254.  
  255. <% 
  256. AlertUserWithPopupErrorDialog
  257. OnErrorGoBack 
  258. DrawCopyrightInfo
  259. DrawStdFooter
  260. %>
  261. </body>
  262. </html>
  263. <% 
  264. LatchCurrentPage "pubpoints/cacheexpiration.asp", qs
  265. EndErrorHandling "CacheExpiration.asp" 
  266.  
  267. PluginsASPCleanup
  268. %>
  269.